home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Best of Shareware
/
Best of PC Windows Shareware 1.0 - Wayzata Technology (7111) (1993).iso
/
mac
/
DOS
/
CAD_CAM
/
A7221V1B
/
DEVLOPRS.DOC
< prev
next >
Wrap
Text File
|
1992-03-17
|
5KB
|
92 lines
This file is intended to provide information for persons wishing to use
the generic portions of the ADI7221 code to produce an ADI conversion
program for a device other than an HP 7221 series plotter.
Please read the COPYING section of ADI7221.DOC before you begin modifying
or reusing any of the code in this package.
While devloping the code for ADI7221, I tried to isolate all of the device
specific code into a few seperate modules. My intension being that major
portions of this code could be reused to build ADI converters for other
devices. As it now stands, the ADI7221 program consists of a main driver
with a few supporting procedures for file I/O and other generic functions,
and a set of device specific functions that produce the output codes used
by the HP7221.
The device specific portions of ADI7221 are contained in the following
files in the ADI7221 directory:
HP7221.C
HP7221.H
HPCODES.H
HPPARMS.C
HPPARMS.H
These files should be replaced by your own device specific modules. The
HPPARMS module contains supporting functions for the HP7221.C module;
your own device specific routines may or may not require a similar module.
You will also have to edit the file MAKEFILE.MSC in the ADI7221 directory.
You should replace EXENAME and INSTALLNAME with the name of your
executable and the complete path to the installed version. You should
modify DEVOBJS to reference your own device specific modules. You should
also replace the targets for the HP????? modules with targets for your own
modules, and modify the LINKFILE target to place your module names in
LINKFILE.
The only modification you should have to make to the generic portions of
ADI7221 is a single #include statement in MAIN.C. You should replace
the #include for HP7221.H with an include for the header file for your
top level device dependant module. This module should provide the
following functions:
int dev_beginplot(PLTFILE *outfile)
int dev_endplot(PLTFILE *outfile)
int dev_move(unsigned xcoord,ycoord; PLTFILE *outfile)
int dev_draw(unsigned xcoord,ycoord; PLTFILE *outfile)
int dev_newpen(unsigned pennum; PLTFILE *outfile)
Note: dev_newpen should initiate a hardware autoselect
int dev_setspeed(unsigned speed; PLTFILE *outfile)
int dev_linetype(unsigned linetype; PLTFILE *outfile)
int dev_penchange(PLTFILE *outfile)
Note: The main program calls dev_penchange and then pauses
for a manual pen change. Since this version is not
a direct feed to the device, dev_penchange will
never be called. However, future versions may use
this function.
int dev_abortplot(PLTFILE *outfile)
Each of these functions must produce a char array of codes and output
those codes via the putarr function. The putarr function and the PLTFILE
data type are part of the inout module.
Each function should return an int value indicating it's success or
failure. Values returned should be as follows:
TRUE - args (if any) converted successfully, no error was
returned by putarr()
BADIO - putarr returned with an error
BADFMT - could not convert arguments to device format
The #defines for the codes listed above can be found in retcodes.h.
The device dependant code should also include a #define for DEV_WELCOME.
This should be a set of arguments for printf that will be printed at
program startup. DEV_WELCOME should be defined in your equivalent of
HP7221.H.
Depending on the characteristics of your particular device, you may or may
not need to create the equivalent of SEND7221. For most devices, it
should be possible to use the MS-DOS PRINT command to send your output to
the device. SEND7221 was created for this version because the 7221
plotter uses a non-standard handshake method that was incompatible with
the PRINT command. Creating SEND7221 also made it possible to use the
7221's buffer more efficiently.
You are welcome to examine SEND7221 and reuse its code (under the
conditions outlined in SEND7221.DOC). In particular, the COMIO module
was written to provide a more reliable method of accessing the serial
port on a PC. This module may prove very useful if you need to
communicate directly with a device.